<template>
  <el-card class="box-card" v-for="item in ShiyanCard">
    <h4>{{ item.creatTime }} <span>~</span>{{ item.deadline }}</h4>
    <ul>
      <router-link to="/upload">
        <li><a @click="displayOnesy(item.id)">{{ item.name }}</a></li>
      </router-link>
    </ul>
  </el-card>

</template>
<style scoped>
.text {
  font-size: 14px;
}

.item {
  padding: 18px 0;
}

.box-card {
  width: 400px;
  margin: 40px 20px;
}

a {
  text-decoration: none;
  color: #b4b5ff;
}
</style>

<script setup lang="ts">
import axios from "axios";
import {onMounted, ref} from 'vue'
import {shiyanStore} from "@/store";

const ShiyanCard = ref([])
const id = ref('')
const store = shiyanStore()
const displayShiyanCard = () => {
  axios.get('/experiment/all')
      .then(function (res) {
        console.log(res.data.data)
        ShiyanCard.value = res.data.data
      })
}
const displayOnesy = (id:'') =>{
  store.id = id
  console.log(store.id)

}

onMounted(async () => {
  await displayShiyanCard();
})

</script>